Refactored the Init function

Got rid of lots of duplication of effort in the Init and
ResetFriendsAndFoes functions