Added debug levels and command line option to set default debug level.
Merge branch 'dev' into test