REFACTOR combine train_wrap and csr_train_wrap

Fixes #1873.