removed unused code
changed LineParser data model
changed fold to operate on entire input
factored state cases into separate functions