refactored the code to remove dependency on john resig's class script and expose more methods to be called by ActivityTracker.method.