Anbangx/genomix scaffolding refactor

This is my refactor of scaffolding code (on github).