AmberGraph: Support both H2 and MySQL

We do this by:

* explicitly encoding index values as BLOBs rather than relying
  on MySQL's implicit encoding

* branching on the database type for REPLACE vs MERGE