issue #5286 - Moved the spam prevention functions into their own file - Added unit tests for the functions