Use only the value of the UID in the NCX

The `@uid` variable contains an Hash with `:value`, `:scheme` and `:id` keys.
We want only the value of the identifier, not the other attributes.
Simplify ID generation
Make sure that generated IDs are XML-compatible
Transform nav Hash parameters into guide parameters

This change allows the reuse of hashes prepared for the `nav` element in the
guide element. Hash keys are transformed before being serialized as XML
elements.