Finished major refactorings of dinodex