added tracekit and show client javascript errors in the logs, minor code cleanup