moved back to flat_map with typedefs (using gcc 4.6.1)

The previous problem seems to disappear with gcc 4.6.1 on iridis.
Added handy define to switch between implementations, but ultimately
reverted back to our faster flap_map dependencies once it was clear
that gcc 4.6.1 fixes the problem. Still not sure about the root cause
however.