More rosettacode

Cleanup of #977 + tests

Close #977