Various code improvements. Yea, I said that. Kill me :-)
Works! Closes #121
Closes #96.