shlo_ref: Move template specializations
GCC gives compilation errors that these template specializations are in a non-namespace scope. This PR moves the template specializations out of the struct scope and into a namespace scope.