Created libbase to contain common code to be used by related commands.

In preperation for creating a second sitegen-related executable, moved the
memory handling code into the /base directory and added a static library
target to the Xcode project.

Updated the #include paths in various files.