Prefix static functions with S_
Remove dead code
Tests for setting Perl lexicals
Fix C89 order-of-decl problem