Huge frontend JS revamp [potentially unstable...]

The JavaScript for the frontend was definitely in need of some
attention, as cramming the client-side code for all the pages into a few
functions was definitely becoming impractical. This commit splits the
client-side JavaScript of each page into "modules", with various
triggers that are ran from the main file. This means that it will be
much easier to manage, neat and flexible. This is the future-proofing
that is necessary for when we are updating all pages' content
repeatedly, which will be coming shortly. This commit also modifies the
way we do charts slightly, so that we can add items to the chart from
outside the options object, as demonstrated in the, currently un-used,
update() function.

This commit DOES NOT provide any actual noticeable benefits to the end
user, and is just a commit that affects the inner workings of the
client-side JavaScript, but it is still very necessary. It is in need of
some extensive testing.