Minor changes

- Cleanup build script
- Put comments in build script
- Ensure we correctly export the PID_DIR variable