Added swapx and swapy functions
Added get_headers_array function to return the header data unit as a js array