Close files that have been opened

In this function 3 files are opened so they should be closed at some
point as well.
Not sure if float(BR) also actually changes BR, but BR=float(BR) works.
Add function to search reference file for decay

Add function to search reference file for decay and return the branching
ration and its error on success and twice -1 on failure

Also added some output if the decay is not found or the branching ratios
are not identical