Constructor into normal function

Errors thrown in a callback won't bubble.
The key validation wouldn’t get to the caller of the constructor.
Changing the constructor into a normal function and adding a callback
fixes this.
A little bit more structure :-)