index: refactor to invoke the function immediately

Also makes return values work as expected as well.
test: add initial mocha test cases
package: add "zuul" as a dev dependency
Merge pull request #1 from component/refactor/immediate-invoke

Refactor: immediately invoke the function