Fix warnings on uninitialised values.

The component was using $file (unititialised) in some places, and
$opts{file} in others.  We make it consistent now and use $opts{file}
everywhere.

Fixes #25.