Feature/jquery rewrite

This solves some of the problems described here: https://www.openproject.org/work_packages/1501.