tweak compile_decs_wrap definition to avoid case split

compile_decs_wrap now doesn't return a compiler_state, but just the
relevant pieces: a contab, the next available label, the code, and an
environment (which could belong either in a module or at top-level).

also, make compile_top just return the code in reverse (so whatever
installs the code can reverse it if necessary). (repl_fun will need to
be updated.)