Clean up CDB classes

- Inheritance was a little funny, reduced some duplication
- Throw CdbException instead of plain MWException
- Abstracted wfDebug() to encourage reuse
- Declare visibility on a couple of public methods
- Move DBA implementations to their own file

Change-Id: I2edfeabaf62e39927abe869764ff2bd676821cd0
Don't use wfIsWindows() in CDB writers

Uses the same logic, but without the dependency on MediaWiki.
Planning to use this in the het-deploy code.

Change-Id: I5d6baf6fe63d135c679e4795287daa0a8722dde6
Merge changes I5d6baf6f,I2edfeaba

* changes:
  Don't use wfIsWindows() in CDB writers
  Clean up CDB classes