Factor encoding into Cryptosphere::Encoding and add tests!

Moving junk out of the Cryptosphere module seems like a good idea