Refactorings and cleanup around exception creation in the core (mostly there). Also fixed random smaller typos and such I ran into.