Use the MySQL memory engine for temporary tables

By default MySQL uses the regular storage engine (MyISAM or InnoDB) for
temporary tables (presumably so they can be larger than RAM).  However
there's a considerable amount of latency to create or delete a disk
backed table, frequently up to 50ms just for one operation.

This commit switches all our CREATE TEMPORARY TABLE statements to use
the memory engine when running on MySQL.

Testing against the production database I found a 200-400x speedup for
for basic traversals, dropping query times down to the submillisecond.
Add indexes on edge table for AmberQuery traversal
Merge pull request #244 from nla/memory-temp-tables

Use the MySQL memory engine for temporary tables