total refactoring / typeSchema cheking

Almost completely rewritten, added typeSchema checking,
path checking, operator revision, docs update, prepared for
reference queries.