Fixes for functions and subroutines with intent(out) derived type arguments

Also updated mockderivedtype example and converted test.py towards a unit test