[#49855163] Fixed a few more bugs; moved all js code used only on dashboard to a separate file.