Add fence tool

Redo the fence automaton tool.
Tested with H2 and PostGIS.