Refactor create and edit log functions. Added timeago.