EBCDIC fixes

We are working to get Perl v5.22 to support EBCDIC platforms again.  The changes here were used on a branch off blead to git this module to work correctly.