Clean up navigation, add transitions

Modified `#nav` background color changing code to add/remove class from `#nav`. Also, use mod function to simplify tracker updating.