Update jquery.riot.js

Quick initial changes to the code base, refactoring to request a pull once I have figured out testing.