Add compatibility with persistent 2.0

tempuhs-server is planned to require persistent 2.0. tempuhs must
therefore also support this version.

Rename the "key" field of 'TimespanAttribute' to "name", as "key" now
conflicts with a declaration generated by persistent. Note that this
breaks compatibility with the old database and JSON formats.

Enable GeneralizedNewtypeDeriving extension to make it build with
persistent 2.0. Update build requirements to persistent <2.1 and
persistent-template <2.1.

Signed-off-by: Stian Ellingsen    <stian@plaimi.net>
Reviewed-by:   Alexander Berntsen <alexander@plaimi.net>
Signed-off-by: Alexander Berntsen <alexander@plaimi.net>