ds1307: Refactoring and cleanups.