Add check for segment_data values being useful
Make parser less restrictive and able to report problems
Some changes to make it work in non-python2.7
Some fixes for flake8