the states method returns all defined states

a project of mine needs to inspect the state-machine for all defined states. It would be handy to have a `#states` method similar to the `#events` method, which returns an array of all the defined states.

The implementation is kinda ugly feel free to replace it with a more performant/readable one.

I've also added a test for the #events method, which was missing.