Move most things over to reflection, removing as many dependencies on NMS as possible.