Code Seperation

A working attempt to sperate out the JS file to allow for multi file usage?