Normalise pattern types when typechecking

Otherwise the erasure of collapsible variables doesn't necessarily spot
them on the right hand side, and we can't normalise there because we
don't have the right context information and forcing has already
happened.

Fixes #596
Set up more partial evaluation machinery

elabPE in ElabDecls now searches for partially evaluatable names (by
searching for statics), creates a new definition and elaborates and
specialises that (so recursively finding any more partially evaluatable
names).

Not finished yet, so call to elabPE is commented out for now.
Fix case split bug on complex nested patterns

Leave 'type' implicit arguments to be inferred, rather than have built.
Merge branch 'master' into tutorial
Added use of gitinfo package to determine version number.

Currently the version number is hardcoded, however, if a special git
hook is added to the repository the version number for the tutorial
can be infered from an annotated tag.