Add gemspec, adjust code to ruby guidelines