add failing test case related to #22
replace modCount with modStack to support diamond-shaped setups
build js