First version of optimal partitioning algorithm included
added cpp11 support
some regressions