Tidying up, documentation

Some changes to make the site more easily adapted for other purposes;
and htmlPage.php now more extensively documented