Add unit tests for appTree -> lambda conversion