More functions

Added the domain filter regex
Added a validate domain function filter
fixed the file handle functions
Added the close file