Renamed function to standard.
Removed unused import.
Added logging settings.
Added some logging.
Added some more logging.
Added global testmode option.