fix: make lookup functions transaction-aware and add mock transaction support
Addresses two critical issues from PR #7 code review:
1. Lookup functions now participate in transactions
- Added dbOrTx parameter to getForumIdByUri, getForumIdByDid, and getPostIdByUri
- Updated all handlers to pass transaction context to lookups
- Ensures lookups see uncommitted writes within the same transaction
- Fixes reply chain resolution when parent and child arrive in the same batch
2. Test mocks now support transactions
- Added transaction method to createMockDb() that executes callbacks
- Prevents TypeError: mockDb.transaction is not a function in tests
Additional improvements:
- Wrapped all multi-step handlers in transactions for atomicity
- handleCategoryCreate/Update, handleMembershipUpdate, handleModActionUpdate now use transactions
All tests pass (42/42).