Support multiple "from" and "to" states

Implements support for multiple "from" and "to" states as already described in the README.