General Enhancements

Did some profiling, read through bugs, did a mishmash of minor things
that mostly just improve performance in the most critical functions.