[Refactoring] Move almost mangling code into mangle.d

lol