State-based elevator controller in Elixir