Some new functions, 4 new DB tables

Signed-off-by: desfpc <desfpc@gmail.com>