ilastik_main: Split main() into smaller functions.