[CDAP-1057] Added program type check, more unit tests