Added phone/IM functionality

Added functionality, refactored and code cleanup