Added Clang support. Code cleanup.