Refactor javascripts
Begin honoring exam modes. Not finished yet!