moved logging to a seperate file and improved loggingCode

- new logger class
- logfiles have now a max size of 500kB
- codecleanup