Refactor script/js bindings, link generation and everything