implement cascading search for ksLookup

needed for previous optimization
optimize ksLookupBySpec
optimize ksLookup
deprecate ksLookupByName

optimize ksLookup
remove duplication of cascading in ksLookupByName
add some more tests