Refactored apply.php so it makes sense now. Also laid the groundwork for candidate.php to work