Rewritten friend system
Improved debugging and small fixes
Fixed friend type issue