massively improved page load function, other minor tweaks

Signed-off-by: William Rockwood <wrockwood@tadl.org>