Dynamic commanded states

This adds support for dynamically constructed commanded states in Kadi.  The current branch is not complete and should not be merged.