Refactored general js file to use jquery. It's now significantly cleaner and smaller.