Added a couple more functions and tests. Added Python 2.7 compatibility.