I know we're likely to redo this file, but we should really be splitting the javascript out into modules from the start to save ourselves work later.