bindings: added support for loading debug extensions

Bindings are attempted to be loaded from various possible
locations where they could be.
fixed a few js code style issues