Refactor the tests
Add #casecmp and #titleize methods
Refactor the main file