Fixed tests, moved code to 21 century Perl