slicht fixes, documentation

Fixed the way the program parses filenames, and some slight things in
the calibration process. Added documentation, too.