Less awkward initialization of lib/def.js

Only run the initializer when the infer module has been initialized

Removes need to lazy-init constraints in def.js.
Improve typing of 'new Array' expressions

Closes #159