Add a first working implementation of offline content generation.

This commit adds an offline mode for the display.page class which allows it
to bypass any operations reliant on it being in a real browser environment.

Add a generation script that will build a static file for each item object
for each type and write it into a per type folder at a given output path.
Make generator write an index page entirely using existing infrastructure.

Use the support for loading various sets of items to load the latest post
and write it into an index page.
Specify valid relative base data urls to the templates.

Be sure to distingish between the index file and the individual per item
flat files; the latter need to prefix their base data accesses with '..'
Make the output path something we pass into the code.

The generator.py file used to have a dependency on the output path config
variable spread thoughout the code. Make sure that we pass down that value
into the relevant functions and make it an argument to the main routine.
Make the generator use the item loading functions.

Do not manually pull out the file names of multiple items; instead, move
the draft check into load_items_finish() and call load_items_by_type()
when we to retrieve all the items to subsequently render.
Make do_index() into a do_page() that is supplied output to render.

We make do_page() a method that renders a page of content into a particular
file at a given path.

Alter do_index() to call this method with it's single content item and call
it in process_type() to render the concatenated short form of all the items
to an indues file.
Include the item's title when rendering it as writing a page.
Implement offline support item template and write out named files.

Add a function that, given a supplied item object, will return a sanitised
text filename that most often will represent the title. Write out the files
with the name it returns.

Item has a new method get_link() added which will return the path to the
item; in offline mode this method will return the static file path which is
requested by rendering the item template in offline mode.
Add offline support to pages.

Do this simply by making the template accept the extra new arguments.
Factor out the path normalizing code into a separate routine.

Put the code which generates safe filenames from strings into a separate
function so it can potentially be used elsewhere.

Use the opportunity to clean up generate_offline_filename - rework the if
so the true branch is the narrow case (only with the page type should we
use it's id) and otherwise go for building the path.
Allow supplying a filename to the do_page function.

Add an optional filename parameter that defaults to index for pages being
written out.
Allow custom index pages by supplying a function through a config param.

We now expect to have a function passed to us through the config options
that is called by do_index to return the content string to output.
Store the filename to be passed to write_file in a variable.
Implement an offline mode writing items as pages into named folders.

We add a variant of the offline generation that outputs individual items
into index.html files which sit in named folders.

We use the previosuly exposed normalize_pathname to generate the directory
names and where we generate a type index we use the type name as the file
name.

Add a configuration file option which enables single mode if toggled.
Add a config options specifying which types to build offline.
Set the get_link offline mode from the offline argument to render().

This bug meant that even when not running in offline we would write an
invalid link for the read more on the post.
Merge offline generation support.
Add a metadata attr 'kind' to pages which skips markdown when set to html.

This change allows us to mark a page as containing pure html deactivating
markdown conversion which would otherwise have lead to visible markup.
Allow specifying a default kind when new page objects are created.

Provide what could be the basis of a generic mechanism for setting default
properies; add a config syntax that can be added to the options object
for specifying default type property values and a method for reading them.

Use the new kind page property as our exemplar of it's use - in this case
it allows making all page objects we load as containing html not markdown.
Record options set from defaults to allow skipping those on object save.

Add a array to all item objects which will contain any options that were
set from config file defaults. Also add a method named is_defult() which
will check whether a named option appears in this list.

Use this support when saving page metadata so if a default kind was set
we do not write it as part of the saved object metadata.