Added support for optionValid
added flatten methods
added utility method
translation of Scala parsing package