refactors more of the js
removes some deprecated code
cleans up switching functions
renames switch callbacks
removes deprecated templates