Added code to handle some custom fields and rules
Removed some unused code
Removed MySQL related code and some old data