Move compilation status completely into state object. Clean up state API.