Use ByteOrder methods instead of free-standing functions
Fix comment formatting