Started refactoring dataScript.js, still needs some work