reorganizes ui
updates primary tab link switching
generally cleans up javascript code
Updates TODO