Refactor the abtest code
add unit tests for transaction analyzer