improved error handling and refactored some common code in
really added missing methods declared in plugins/file.js that were not in mock/file.js this time because I forgot to save the file.
Revert "really added missing methods declared in plugins/file.js that were not in mock/file.js this time because I forgot to save the file."

This reverts commit dcf89363b0eab25f0975d03c1a189307267d393d.
Merge pull request #335 from mzbyszynski/cordovaFileCleanup

improved error handling and refactored some common code in $cordovaFile