second shot at endianness issues
Remove the (buggy) fragment handling so far
remove dead code
add "debug" variable and wrap all debug outputs to appear only when debugs are on