Add ordres sniffer and tests

Also refactor some of the parsing code (still more to-do).