Add unload() function

Also factored out some state initialization into
separate function.

Change-Id: Icf8eb11b2df352df289075985e8d9962890d6fd2
Merge pull request #8 from spotify/enewett/unload

Add unload() function