Sounds like you're experiencing the classic "obsessive compulsive disorder", as they call it. Alot of people get caught up in thinking patterns like that (i know). I'm not a doctor, but I think it has something to do with feeling out of control in your life. My non-doctoral advice is:
1. Try to figure out what bigger issues are unhinging you.
2. Don't worry about it too much. They're just thoughts and they can't hurt you. You're not actually going to kill anyone, you're just going to keep freaking out *thinking* about it if you let yourself. It's the fear that's driving things. The more you feed it, the more you'll worry. Don't make too big a deal out of it.
3. Get support. It's good to unburden yourself, not just about the fact that you're having disturbing thoughts but about your life in general. Whatever larger things are stressing you. Get counseling if you feel you need it (and make sure you get a good shrink because some of them are for crap).
Hope that helps at all. Good luck in all matters.