Refractored to Use singletoon Pattern instead of the procedural code earlier.Updated to work with WordPress Multisite 3.2+ and BuddyPress 1.5