move main.cc to support multiple launcher mains