first cut at major performance tuning

this commit still has a few crashes but I needed to get the bulk
committed