Identifier cleanups and default DB ids.

Always use the database identifier instead of leaving it blank, which makes it explicit that integer identifiers are preferred. Also, style changes to not use python keywords as variable names and one less external dependency.