Minor improvements

Decouples dependency on a browser - for future node-side support.
Changes the 2nd mode to prep for working on collisions creating stars.
Cleans up some other minor code.