Simplified the log level name <--> number lookup in a few places.

Just a few refactorings more, and all functions will be one-liners... :smiley: 
Cheers, merged.