Fix strstr call on base64
Parameter consistency check; misc changes
Rename more files; more type checking