All this should be done test driven
Added rake task for unit tests