Cleanup and adding more unit tests to query serialization and field collection