Add last seen info to the database

Fixes #612
Merge pull request #626 from SamWhited/issue612

Add last seen info to the database