initial implementation of DocumentType::getLoader()

i dont actually know how this service is used in practice. also as per the todo i added i guess it would make sense to optionally also support the query builder.