cleanup: various refactorings and minor formatting changes and cleanup

This probably needs some more testing, so there will likely be
follow-on commits on this branch.
bugfix: fix bug with child non-root nodes not having correct href
bugfix: Properly call into UserLib namespace when calling getDisplayNameById
bugfix: Fix another bug with getDisplayNameById
bugfix: fix a few more bugs from the latest batch of changes
Merge pull request #91 from posborne/code_cleanup

Code cleanup