Added a function to test if a string ends with another string
Added support for text uploading and using a function as file validation