Added check file script and moved scripts to lib directory