Fix imperative ifnode ast comparison

1. Fix ast comparison - compare the correct ast + remove unnecessary check for ifbodyposition nodes (this node is unused)
2. Add imperative ast comparison testcase

PTAL @ke-yu