fix for issue #254
more thorough error checking
more succinct way to get file sizes
use 64-bit off_t for file sizes
a few general fixes
move to page end after pressing return
a few UI changes