Bring code up to date with Eq changes in Rust

This contains two kinds of changes:
- TotalEq was renamed to Eq, so where TotalEq was derived before, Eq is
  now derived. This required also deriving PartialEq, since it is
  required by Eq and not derived automatically.
- Where Eq was derived before, derived PartialEq in addition to make it
  compile. This is not equivalent to before (since the old Eq is now
  called PartialEq), but I saw no reason to only make the weaker
  equivalence guarantees provided by PartialEq in those cases.
Bring code up to date with string changes in Rust

This includes two types of changes:
- Replace ~str with String. I don't think ~str is meant to be used any
  more. It no longer implements Show and the API returns String where it
  used to return ~str.
- Add explicit conversion from String to &str where required (as_slice).
Changed build to make it work in my own project.

I need to link it statically and I don't really see a way to do it
without hacking the way it's built.