Added file/beam conversion functions from lfetool v2.

Fixes issue #12.