More refactoring

Added unit tests, removed some redundant code,
removed parser from settings -- it was hardcoded, so
no real reason to keep it there, amended logic for
parser application: previosly only default sentinels were
used in parser selection optimization, now a sentinel is
picked from settings.
14 files changed