Added endianess check
Added external test file