refactor: sql to pinia data transformer

Updated the transformer to make it more generic and re-usable. The transformer takes database rows and converts their column name aliases back to original name and normalizes the structure. See: http://web.archive.org/web/20211109135144/https://forum.vuejs.org/t/vuex-best-practices-for-complex-objects/10143/2

{
user: {
1234: {... }, // ids as keys
46473: { name: 'Tom', topics: [345, 3456] } // keep only ids of nested items.
}
}