Profile writer done

Description of format is inside.
I will also write a profile reader tomorrow.