Addressed review comments. More unit tests, apache headers in new files, generic tracing instead of console.writeline, refactoring of constants and making parameters configurable.