Fix issues around URL generation.
Allow entity lookup by name, fixes #12.