add: finish encoding, isolate encode statements into encode(), flags

The program can now encode to base64. It takes a encode/decode command
line argument to select mode. All encode statements have been moved into
the encode function. Updated the framework to use strings instead of
arrays. If the user does not specify encode or decode mode, printUsage()
prints usage information and exits.