Refactor tests and ensure they all pass on Python 2 and 3

This is an alternative to #61 - just includes all the changes related to tests but does not make ATpy into a proper affiliated package (since it will be deprecated and maintained only for legacy purposes).