rewrite source code

improve source code for easy reading.
shorten insert/update active record.
rewrite source code

improve source code for easy reading.
change from sql query to active record
and shorten long insert/update active record.
rewrite source code

make source code easier to read.
shorten insert/update
fix bug db prefix

fix always db prefix, add check table name exists. (table.field)
Merge branch 'master' of https://github.com/vee-bizidea/agni-cms into development

Conflicts:
	application/models/comments_model.php