adding in break after goto for consistent style
correcting error handling for parse_write
correcting error handling in parse_expect
minor fixme note changes
refactoring to centralise string parsing
 refactoring to centralise number parsing