reimplementation of select2

* added doc for conditional wait
* reimplemented select2
* minor modification of clip2 test and flag2 doc