[DDMD] [refactor] Move Statement::toCBuffer into a visitor

@AndrejMitrovic Part 1, fairly straightforward.