minor refactoring

added utility functions to compare and extract strings
implement  pragma plex_test name_count

all 3 files pass test