Bunch of cleanup, routing, schema work

Sorry for the huge commit