(maint) Add comments, more support for v1, placeholder text

Prior to this commit, my functions did not have comments, and the
support for puppetdb version 1 was lacking. This commit adds
comments to the code, some logic to handle v1 queries, and it also adds
the functionality where placeholder text will show up when the
textbox is empty to give users an idea of what should go into the
textbox.