Protostellar Collapse and Fragmentation: Describing and Testing a Second-Order-accurate Radiation Hydrodynamic Code