Clean up rdm.cpp a little. Also add support for -Wlarge-by-value-copy though something seems not to work with it