Tighten gem dependencies

It is a good practice to use ~> for runtime dependencies in order to prevent
things from randomly breaking.
Make 'rake' run all the tests

This is a pretty standard pattern.
Use Hash.from_trusted_xml instead of Hash.to_xml so that the tests pass