Finish more of the main chrome script. Added new script for functions.