add parse_typed helper, to be used in OBS

This is do decouple the on-disk filename from the internal
filename. You can call recipe2buildtype to get the type and
then parse_typed to get the file parsed.