ClearCase: Refactor and add tests

Refactored code to make it more testable, and added tests. When running
WITH_TESTS the TestCases will make the plugin fake ClearTool such that
ClearTool is not needed to run the current tests.

Change-Id: I49b50a667309cf337a07ef20dabb4801c680700d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>