Added basic retry mechanism. Added tests. Renamed a few classes.