add reapply_minecraft_patches.py and miscellaneous improvements