Refactor jsbuild

This is a major refactoring of the refactoring / debugging system.

It should simplify how the needed js file from the different libraries are loaded (not anymore hard coded)

Resolves #151.

Please review.