minor optimisation to parser, more test cases, updated readme