Globalized variables, added a few methods

Realized I'll need methods, so had to make variables global instead of
local. Also added method that finds length of unique values in the
$animal_location array. If it's 1, all animals are in the same pen.