Phew!

1) Oops. Moved the registry class from the /database/ folder.
2) Added factory class.
3) Added a query class. Useful for building queries instead of having
to write them manually.