Refactor JS entirely into backbone framework