Changes to Perl API and stored procedures for speed improvements
More changes to Perl API and stored procedures for speed improvements