Code cleanup.  Refactor layout dpage code into separate module.