refactored some javascript models and renamed some files for consitency