Big cleanup: Logging

also fixed some spelling mistakes, missing copyright comments etc.