Allow Title to be specified in metadata instead.
Pass the element down to getRef, so I can print better error messages.
Massive rewrite of the docs.