It sounds like you managed things pretty well and stayed in control. So good for you too! Being in a position to split up without losing everything is something we don't all prepare for. In my case it was by pure luck. I had to go scrambling for the copyright laws and eventually worked out that my code would belong to me (according to definition of employee, work for hire, etc.). It could easily have gone the other way because I didn't consider things going sour when I started, and by the time I became concerned, I was already too heavily invested in it to want to risk starting a fight.
Having a written agreement about copyright ownership like you do is absolutely essential if the code is something of value. Without that you can never really be sure who it belongs to.
Having a written agreement about copyright ownership like you do is absolutely essential if the code is something of value. Without that you can never really be sure who it belongs to.