Trimming right side of each read line, to avoid line ending problems.

Removed C style parsing of numbers, using boost::lexical_cast instead.