PDF text extraction feature + debugging

- PDF text extraction feature added
- Some bugs removed from PHP and Javascript code
- A new class method for all controllers that can load views using a
template has been added.