improve Program abstraction

self-merging @tleach