Reorganized navigation bar code.

Use includes for common lines.