#id to reference. Optional loader

Switched from passing the id variable to passing a reference to the
element. My project uses dynamic container divs and passing a reference
integrates into the code nicer.

Added separate option to display a loader as my code uses a separate
loading animation