Updated build scripts with OS X fixes and added some building documentation.