added some error recognition pattern
add a .gitignore for easier committing
added more error handling routines
revert main.ml to run test cases only