Minor Refactoring

CODAP specific javascript code separated in it's own js file which gets loaded automatically.