Support for invokables and not just Closures

Continuation of #59

--

Use an `isFactory` and `expectFactory` method instead of `Closure` type hinting, and some refactoring.