Initial commit, partially working merger (misc bugs need fixing)