Removed class << self statements

Instead, I'm using a trick I saw in the Celluloid codebase, namely
`extend self`. Neat.
Added more specs
Fixed cosine distance