Consolidated various javascript functions

Created a single .js file to hold random functions needed for the
project, rather than a single file for each individual function.