Look up "the twenty factors"; sometimes they're called "the twenty questions".
The IRS, and California at least but I expect the other states, consider you an employee or a consultant depending on the nature of your relation with your employer or client.
The factors are whether you provided your own equipment at your own expense, whether you were exposed to the financial risk of failure - that is, would you get paid anyway, even if your code didn't work - whether the employer could tell you when to arrive at work and when to live.
To be perfectly clear: neither your contractual relationship, nor on what form your earnings were reported have any bearing in the IRS' decision.
No one factor determines either way, it is the preponderance of the whole being one way or another.
I say you have grounds for an unlawful termination complaint. If you don't have the cash to hire an attorney, you may be able to find one on spec. If you have the kind of attitude I do, you could represent yourself pro per, that is, without any legal advice, or pro se, in which you speak for yourself but with an advisor who does not speak directly to the court.
http://www.powells.com/ has lots of legal texts dirt cheap. http://www.nolo.com/ has very good self-help legal books. Most courthouses have law libraries that are open to the public.
May I, in the most polite, friendly and helpful way, suggest that you write a registered letter, return receipt requested, to the IRS and your state tax board to suggest that your former employer may be guilty of tax evasion.
If the twenty questions come out saying you were an employee, and your employer didn't pay state or federal unemployment insurance, or IRS Form 941 payroll tax withholding, then that could be a felony for which they would do time. This because failing to pay payroll tax, or failure to file the 940 and 941, are regarded as stealing from your own employees.
The simple failure to pay tax is generally not a criminal offense but it is in the case of failing to pay payroll tax.
While I am not an attorney, this is a topic that i am intimately familiar with.