Moved js out of plugin file

Cleaner!