[RDF] QNAME fixes

* Allow periods in QNAMEs
* Don't break when there are illegal characters in the predicate. Use the strategy proposed at http://www.w3.org/TR/2014/REC-rdf-syntax-grammar-20140225/#section-Serialising (generate namespace that consumes all illegal characters)
* More robust namespace name generation

Closes #128