fixed errors from first checkin and added simple tests
Merge branch 'master' of https://github.com/foadnh/artin
merging foads changes with mine.