Add check if register function exists, if not throw Error

IMHO better to use [assert.throw](http://chaijs.com/api/assert/)