Tests

Added some tests, also changed __unicode__ to __str__ for future versions of python, cleaned up code for consistancy.