Fix a nasty bug where each subsequent page to be written would contain all the contents of the previous page.

Move settings to settings.php so that base files can be replaced wholesale on update.