Conforming the gem to more of a standard code style

A significant amount of changes.

double quotes to single quotes,
variable spacing,
key/value spacing,
remove useless statements,
change most of the raise statements to fail,
change some loops to use kernel#loop,
fix build failures,
update gem spec