Fixed navbar functionality such that the "active" status of a nav link is determined programmatically.