Potions support

Finished adding support for potion effects on totems.  Also a little
code cleanup and more TODOs