Move code to set longitude/latitude into a function.

This is a code refactoring to be used by the undo support.
Add generic undo support in darktable.
Clear undo list when switching views.
Add undo for image position (geo-tag) in map view.

This used the new undo generic support.
Add support for redo.
Prefix all routines with dt_undo_ to avoid polluting namespace.
Cleaner implementation for dt_undo_clear.

Make sure we also clear the redo list.