Implements lastsyncdate and fixes some minor issues.

Closes #2 , Closes #66 and updates code to newest ongr strict standards
use constant for 'last_sync_date', o configurable parameter