Move chat filesystem format from infinoted plugin to libinfinity

This way other note plugins can share the code.