Added gem instructions. Fixed some specs. Refactored some code.