core refactor to make bootstrapping much more modular and allow server to detect platform