Refactored JavaScript into separate build files