Replace the external state_machine with an internal implementation


https://bugzilla.redhat.com/show_bug.cgi?id=1089061

Please review the current work. The internal state machine completely replaced the need for the external state_machine gem for VM scan. But there are two other places the state_machine gem are still referenced. I am making the same changes. They will be added to this PR shortly.