server: refactor Timer to accept GSourceFunc as callback points