Move BASE_DIR definition to the settings.php file

This makes it a lot easier for other files to properly load
everything (such as ajax stuff).
Add the AjaxPost class to the Vir namespace
Prevent extra validation from occurring if already invalid

Also added a different message to be posted if the variable
is completely missing.
Base setup for the ajax front-end