making a commit just before reorganising everything(fixed a lot in the reason voting part for this commit)
Restructuring done+ some ranking theories

The restructuring has been completed, all major functions now reside in
'php/functions.php'.Also wrote some pseudocode for the ranking algorithms,
a great cleanup in the actual code has been done as well.