Changes for task and project JavaScript files

These changes were intended to encapsulate the code and allow for the
code to be more testable to provide greater code coverage.