Refactoring

This is an attempt to improve readability and add some tweaks to the existing code.
After this I plan to add the ability to paginate results from search queries if possible but I'd like this to get thru first.

- [x] Docblock refactoring
- [x] Replace all ``` array_key_exists() ``` with ``` isset() || array_key_exists() ``` to improve performance
- [x] Don't pass objects as references
- [x] Improve method type-hinting and constructor initialization
- [x] Enable error logging on-demand only, default disabled
- [x] Allow all tests to run if one fails
- [x] Fix small bugs