add unit testing for Skip/SkipWhile/Take/TakeWhile functions, and fix a few issues found in unit testing