Add #applicable_states instance method to Machine class.
Fixes #23. Refactored as discussed.