Merge of new validator with tests

Per @gvwilson request (issue #34).
The 'U' open mode is deprecated (at least starting with Python 3.4, see http://bugs.python.org/issue15204 for more information). Should we remove it?