Added ::canReturnType()

Added static method ::canReturnType($type) to check that the required
classes / functions for the type of return exist.