loopfrom fixes and improvements. loopfromend changed to loopFromFlush
refactoring on getCreatedIndex to getUniqueIndex
condition polishing
loopRange improvements and tests
added loopfrom test