Merge pull request #83 from gavinlaking/twerks

Refactoring and improvements
Write warnings to log file if terminal is too small.
Minor formatting changes.
Add more documentation.