Question 1
You need to explain more what you mean by a "module". Could your module be considered a derivative work of 3PS? If so, it could violate copyright law and/or the agreement with third party.
If not a derivative work, you also need to look at whatever agreements there are with the third party regarding the data. I suspect it would not be prohibited by the agreement, but you need to check.
Question 2
You need to look at your agreement with your client. Your client may own whatever software you write for it. If you don't own it, then you will need permission.
Assuming that your module is not a derivative work, does it contain any trade secrets or confidential information of third party? If so, then you probably can't sell it.
Another option would be to sell it to third party.