Add space after commas in XS code
Consistent formatting for XS code
Use a typemap for magic_t rather than explicit cast to/from long