Move phantom page creation/loading to a separate module
Refactor the command flow 'end' function
Re-add some log/debug messages
Add elapsed time to the debug messages