Use optional<> in basic_string_view to get rid of the potentially unportable "npos" hack
Doxygen fixes and code structure