Add OU support to DB and stdin datasources.

Add OU support to DB datasource, updating DB configuration to use a
dict like the LDAP datasource. Add OU support to stdin datasource,
adding a config value to turn it on and off. Clean up, make minor
improvements and miscellaneous fixes.