First pass at adding working code. This has been run in development
and appears to not act in an evil way, but additional testing is
required.

So far the main driver has been to get it working for a setup where
user prefs for SpamAssassin are in MySQL and in this environment it
performs as expected. Other configurations have not been tested.