Fix issue with state var in main(), handle parser calling exit, add State.setup()