cleaned things up and added tests for the chunk parser