lib: fix "defineHook" bug when called with object

- also, add addition validate to throw errors immediately
and prevent errors after app has started
Release 0.0.2