added table prefixes in all the SQL functions
fix database prefixes in installer