rework code into the widget object, and add start, stop, and rotate callbacks

As modeled on the jquery-ui resizeable code:

 * all functions are now part of the widget object
 * converted tabs to spaces
 * general cleanup of variable names
 * added start, rotate and stop callbacks

I plan to add some code to the example, but I figured I'd post what I have so far for review. Apologies for the ugliness of the diff, the refactor was pretty major!