jquery bug fixes / refactoring jquery + erb/routes

This was never used on the erb. No need to add code if you're not 100% sure it will be used.