Rearrange site_map array
Using path as key should make next() & prev() easier
Clean up duplicate code