Made some functions return Lwt types instead of using Lwt_main.run

We previously needed to use Lwt_main because distribution was actually
asynchronous due to using the Python slave internally. Now it has been
ported to OCaml, we can clean up the other APIs.