Tons of cleanup and starting to rewrite core...