Attempted fix to ensure that autoloads are actually removed when uninstalling

This is my attempt at fixing #446, using a modification of the code that @jd posted in the comment thread.

However, this still doesn't quite remove all traces of an uninstalled
package. Some comments are left behind, and I don't know if they are
functional or not.