classing up the joint

wrap actions in methods, wrap methods in class
add real(er) test methods