Add markgen module and unit tests