Refs #410. Fixed some namespacing and stopped the script from calling functions just from being included on a page.