Allow chaining of require()

Also adds a test for it.

Fixes #45.