complete refactoring of javascript files. statue.js complete. prepares for other files.