Moved code setting the "time ago" display to a library method as it will be used again elsewhere.