Functional version migrated from private library

TODO:

* document better
* provide examples
* add liscence
* publish on packagist