HFA work, add CCN merging, subapp support and a lot of fixes