The ownership of the IP/product will be most contentious topic I'm guessing.
Be very very careful about the legal side of things, work with a lawyer that knows this topics. Being on their payroll can give them rights to the product/your work depending on the laws of your country.
Make sure the include every detail in the contract.