MongoDB-powered functional entity system