javascript moved to assets, commets added to uncommented functions, reduction in instance variables and general refactoring