Cleanup of existing validation logic.
Add test plumbing.
Emit appropriate status code on error, added tests for invalid PHP uploads.
Add config for ci tools.