Mostly implemented foundationdb adapter

There are still 66 failing tests (out of 600) on the integrated tests, and probably more tests that could be implemented. Plus the possibility of grouping support. But it seems like fixing some of the bugs that cause those 66 failing tests are more important right now.
TODO is now stale, right?