Fix vaddr_to_offset and offset_to_vaddr after the base address changes

Previously, `vaddr_to_offset` and vice-versa would break if you changed the base address from the default.  This fixes it and adds doctests.