Integrated extension with MW database system

The extension is now integrated with the mediaWiki database
updater. This involved building .sql files in patches directory.
All the table and field names are now referenced by constants.
This forces tighter coupling the mediaWiki although besides
defining constants (which i should've done to begin with) very
little was needed to integrate with mw database. I don't currently
plan to use the MW DB functions but that might make sense at a
later date.