Split main into ls_main.c