Refactor script/js bindings, link generation and everything

This is nowhere near completed right now, just opened PR for reviewing convenience and discussion.
Seems like you are leaking ScriptJobs all around the code, I don't see where they get destroyed.