Add pytest and tox to testing pipeline

This is the first step towards Python 3 compatibility.