LMSConnector : code improvement

Create a function ParseAnswer that parses all the tokens of an answer.
This replaces a lot of awful copy/pasted code!