Improve realtime registration

Fix making of colored overlay
Make memmap_scratch function for testing
Scrap changes