Added rake task and tests

Added rake task support.