Implements lastsyncdate and fixes some minor issues.

Closes #2 , Closes #66 and updates code to newest ongr strict standards
is it correct way to do?