Add tests for the MemoryBackend. Closes #27. Closes #17