Make NBTTagCompound.get<type> faster and threadsafe, move some non-patcher-specific code from PatchManager to DomUtil.

Signed-off-by: Ross Allan <rallanpcl@gmail.com>