Fix label and query mechanisms to do virt->phys address translation properly for
whole-system mode.  Also, get started on some code cleanup.