Implement new JavaScript routing system.
General code cleanup (tabs to spaces).