Cleanup as result of testing while actually plumbed with pdns

Backend
- Changed specification of domain to not require leading dot
  This is now handled by the code (as it should be)
- Massively overhauled query logic for efficiency and readability
- Removed debug flag. Only actual problems are logged.
  This was a side-effect of the query logic overhaul.
- Added handling of SOA record
- Fixed actual AAAA response. Was lacking id field.
- API error log message clarified

Test script
- Added test for SOA record