Multi-purpose finite-state toolkit