Fix a declare in the database object generation, did not remove _id.
Removed *_list_begin() and reworked all the code that used it to use *_list_next()/*_list_get_next().
Reworked code to use the new *_new_*()/*_clause() functions to condense code and make it more readable.