Fixes #414 - integrates rubocop gem

Adds rubocop gem and fixes majority of issues noted by cop.
Please add a space after opening bracket and before closing bracket. Also, use new Ruby hash syntax.