wip
Made the "before" handler run only once. Removed debug puts.
Turned the module into a class.