A high order special relativistic hydrodynamic and magnetohydrodynamic code with space–time adaptive mesh refinement