Reorganized source code, implemented parallel chains
Added test scripts