reg: Clean up reg_add
reg: Clean up reg_delete
reg/tests: Add query tests
reg: Implement query functionality