String similarity tests

Refactored and cleaned up string similarity, fixed some bugs in string similarity, and added tests