Add generator -> stockholm implementation

Needs unit tests.