Well aren't you mister negative here. If this guy was just an employee the tone of this thread would be very different. Every CTO knows there's coders that can just drag down the efficiency of the team. Every programmer knows in his bones that some programmers are poisonous to your codebase, even if they get shit done.
So how about a third option: They are just trying to cut out dead weight from the company.
So yes, get an attorney, yes, make sure you get what you deserve. But don't assume your friend (your cofounder is your friend right?) is backstabbing you before you are absolutely certain, no use in getting bitter before the hurt is done. A startup is a business, and businesses need to run efficient to succeed.
Asking you to leave, and asking it to be in three to six months, that's quite different than doing it suddenly when your grandmother dies. To me it sounds like they're doing it as classy as they can.
I'd say, if you really want to keep working with them, step up your game, make sure you're the programmer they need.
In any case, lawyer up, you have risked a lot going into a startup, so you most definitely have rights to that slice of the money pie when it comes.