Added rake task and tests