Made the code a lot DRYer by adding a 'self' class.

Instead of having:
	def self.foo
		#...
	end

	def self.bar
		#...
	end

I've added it into a self class like so:

	class << self
		def foo
			#...
		end

		def bar
			#...
		end
	end

This means method names are a lot more descriptive.