moves borrower country IP address detection code to single function in database file. to do: improve this function to detect the array of currently active borrower countries so it does not need to be manually updated