made setup more generic
moved testing logic into an abstract class
Added tests for matching beginning of strings