First I don't practice in your state, but in my view you need some sort of agreement or formal assurances that you won't be charged and that your testimony can't be used against you in anyway. At the very least you should have the prosecutor place those statements/agreements on the record in court. I would ask for it in writing, and in most states you would be entitled to court appointed counsel to advise you and represent your interests, assuming you don't have the funds to hire your own lawyer. The likelihood is that the prosecutor will stand by his word but you can't and should not assume that, especially when you're dealing with possible criminal charges and you're not represented by counsel.
You should be extremely careful about testifying to what could constitute a crime while in court, or even admitting to it to the police. Although honesty has helped you thus far, you should get a formal grant of immunity for testifying. This means that you should get a promise in writing that the prosecutor will not prosecute you in exchange for the testimony. If he won't give it in writing (not just on the court record) I would not trust him.
You can always take the Fifth to avoid saying anything and inform the judge that you feel you should have immunity prior to saying anything incriminating. It sounds like the prosecutor will give the immunity and that you won't need an attorney, but you are entitled to one if you need it.
Best of luck,
Shannon K. McDonald