Re write lib

rewrites to use ActiveRecord after_commit callbacks for basic events and a new `commit` method for success and failure events.