Code runner class, returns output and catches exceptions.