Added support for finite state machines.

Finite state machines can now be added to package libraries. Handling is
not fully implemented yet, but will follow soon.