More major javascript object refactoring