and front-end manipulation, and it's really not my area of expertise, so
don't be harsh.
All you need is to use and call this function with a selector (only useful
if you have several tabs/pills divisions) when the document is ready.
The first part takes care of showing the good tab based on the hash
contained in the URL. The second part takes care of changing the document
location to add the current tab to it when the user clicks.