large refactoring and bugfixes

 * improved error handling
 * added comments to sigal config file
 * refactored History code in a class
 * record history entry file earlier, to better recover from crash
 * upload TTL file earlier, same reason
 * fix --relative use with TTL and stdin (issue #1)
 * accept directories for gallery generation
 * spell-check documentation
 * more code comments