Adds debug option and multiple queries support

Also adds minimal documentation for developers