Package up elab_top and infer_top

Define elaborate_top and inference_top functions in repl_funScript that
better encapsulates their interfaces (at Ramana's suggestion).