Creating and Repairing Robot Programs in Open-World Domains