Refactored navlink object generation

The navlink code throughout the project is messy and duplicated; need to
think how this can be generalised... Should it be part of the API
itself, for example?