Added possibility to retrieve value types from Config

Also replaced unreasonable uses of (is|as)instanceOf with pattern match
+ little syntactic fixes