Document Model and Query Layer for FoundationDB