[db] Adds self-made-hashtable-based database. Introduces transactional macro definitions.