update 0.2.2

cleaned up code; fixed some bugs; can now specify an 'on' event (JS) to
trigger load