Refactoring

Changes:
- Added copyright headers to code files
- Split blog-related database functions into their own file
- Split auth-related database functions into their own file
- Fixed a regression where the number of posts in a multi-post reply was not being properly restructured