Re-structure clang-rename into a library and the tool.

This allows the unit tests to link the library.

Patch by Xin Huang.