Refactorings, more test code, less BaseX dependencies and a first shot at XQDoc.