add ability to read from stdin, for fuzz testing. seems a bit dodgy