added support for requiring

just work in progress, no stable api yet