[feature]Zhihao: add validation and refactor tests.
1. add validation for uploaded file. Used a ugly way to attach error
message.
2. refactor tests. Pull out revert work as a single file for all the tests.
[feature]Zhihao: Merge code
Conflicts:
	test/lib/jobs/job.js
[feature]Zhihao: fix merge