Cleanup related avatar service implementation

Various issues:
 - PM code now uses avatar service
 - Gravatars module gets proper preferences
 - Correct some issues related to namespaces
 - Implement proposed changes in Xoops.php