These 7 patches replace the first 6 of the previous series, after Keith's review. The new patch just cleans up some code before we add gpu support to it making the patches cleaner. Dave.