Add domain restriction framework

Formatting changes made to code
Removed unused functions
Changed verification from string to boolean for better code readability
Added setting to config files in both agent and server