Improved performance by changing log levels from strings to numbers

This obsoletes the switch-statement in toInt(lvl). We have to get the log level name in log() and consoleLog(), but this is a simple property lookup.