Add state machine gem with model for applications