add some security checks in ballot.php stemming from class fns in election, voter and sge
merge security checks, some refactoring from votes branch