Move main.go to ReservoirMain, add exit handler for cleanup.
Signed-off-by: Robert Xu <robxu9@gmail.com>