Permit lore-specific annotations in result types.

Not quite finished yet.
More work on result types.
Add ppIdent function.
Add removePatternAliases function.
Work on type-checking memory annotations.

This revealed some problems in how ResTypes are made.
Get rid of a use of extResType.
Add ReturnsInAnyBlock.
Merge branch 'master' into explicit-memory

Conflicts:
	src/Futhark/Representation/AST/Pretty.hs
	src/Futhark/Tools.hs
	src/futhark.hs
Getting rid of orphan instances through re-organisation.
Fix some type annotations in shape optimisation.
Add FreeIn instance for ResTypeT.
Some small cleanup to DeadVarElim.
Make bodyType return a ResType.
Make a Pretty instance for PatternTs.
Add "existential" function.
Fixes to explicit memory handling.
Fix handling of memory annotations for do-loops.
Fix parse error in test.
Fixes in how memory annotations are added.
Fix type-checking of shape in ExplicitMemory.