Types introspection refactoring / improvement

Yuri Kotov simplified types introspection via usage of already existing runtime api instead of custom type check. 
Removed boxing of scalar return types.