Merge pull request #525 from memimo/infstop

added inf termination criteria
Composite Layer bug fix
Merge pull request #529 from memimo/composite

Composite Layer bug fix
Added time budget control.
pyflakes: unused exception name.