initial rewrite commit
add all the tests

Signed-off-by: Stephan Pavlovic <stephan@railslove.com>