WIP on imrpoving error handling
A bunch of pointless rearranging, and a few new formatting functions