Forked Riasel, fixes duplicate items, miscellaneous fixes and
refactoring.