Add fsm.py module

This creates the ironic.common.fsm module, which was imported from
TaskFlow and modified to fit the use-case of Ironic.

Notable changes from the fsm.py module in TaskFlow are:
- removing the table printing dependency
- basing exceptions on Ironic's exception class names (which, it turns
  out, are almost identical)
- adding a test_event() method
- allowing the state to be passed when initializing a FSM
- allowing shallow copies of state machines
- adding target-state-tracking to fsm.py
- adding target state initialization to states.py

Change-Id: I813e60563c3e5124e31183b9322152df830b2f8e
Begin using the state machine for node deploy/teardown

Start using the state machine:
- first, add a process_event() method to TaskManager
- then, use it for both do_node_deploy and do_node_tear_down
- finally, add it to cleanup_after_timeout

This simplified both methods in ConductorManager, and also exposed a few
shortcomings in unit tests.

Change-Id: If2bb15c8300d28551946ff6053da6713faaadb4b
Refactor async helper methods in conductor/manager.py

This patch performs multiple refactorings of conductor/manager.py:
- re-arrange a few class methods without changes
- move some async helper methods out of the ConductorManager class:
    _do_node_deploy, _do_node_teardown,
    _provisioning_error_handler, _power_state_error_handler
- move _do_sync_power_state out of the main class.
  However, this required returning the count instead of simply updating
  self.power_state_sync_count, so a few test changes were required.

Change-Id: I07497228cafab73df12253a5e652069a0a9918cb