Hi and welcome to Healthcaremagic. Thank you for your query. I understand your concerns and I will try to help you as much as I can.
This may be r related to 
IBS andchronic 
constipation (spasms). That is particularly true when you consume foods like nuts or popcorn that would trigger spasms of the bowel.
I suggest to run 
colonoscopy to exclude organic problems first. 
With regards to finding blood floating in the toilet after you pass the motion, that would be related to possible:
- fissures due to chronic constipation
- hemorrhoids
In both cases, you need to take measures to reduce constipation that would trigger such problems: 
- do more physical activity
- increase water consumption
- take more foods high in fiber content
- fiber supplements can help
- can use laxatives once in a while to improve the symptoms
I hope I have answered you query. If you have any further questions you can contact us in every time.
Kindly regards. Wish you a good health.