Re-arranging setup for the .js file so I could include a path for all the calls depending on the hosting.