adding support for both require and register API

Strange-looking merge, but just adding `name` and `version` to exports and added `register` test.