added type cast methods for Java DSL
implemented the majority of the groovy DSL for the new matchering code