Move router initialization to main.js. Stop RBTree rotations from being looped infinitely.