moved applyPatches into compiler package (#36)