Fixed bug where location wouldn't change but previous index was still removed

- Fixed bug where location wouldn't change but previous index was still
removed (was due to code running after an early resolve() in a promise)
- Added test to catch this bug in the future
- Fixed timing issue in nextBus node script so that example demo is now
completely in sync