Solved part of my issue. Changed the code in cas-maestro.php in the relevant section to the following:
//$exploded_name = explode(' ', $user_realname);
//$firstname = $exploded_name[0];
//$lastname = end($exploded_name);
$exploded_name = explode(',', $user_realname);
$exploded_first = explode(' ', $exploded_name[1]);
$firstname = $exploded_first[0];
$exploded_last = explode(' ', $exploded_name[0]);
$lastname = $exploded_last[0];
And now it properly parses the names just how I want.
Now I just need to figure out the email issue.