bootmem: reorder code to match new bootmem structure