Use value_type provided by a terminal for type deduction

refs #53
User-defined functions have return type as part of signature

refs #53