Moving all codes from ascidoc to Groovy scripts. Modified the test cases, all green