I would like to stop windows from entering into neighbouring workspaces. I would like each window to be self contained inside the current workspace.
Also, how can I stop windows from going underneath the unity bar?
This is currently a defect in Unity/Compiz. The best you can do is to enable edge stickiness. In ccsm (not installed by default because it's unstable as all get out), go to Window Management and enable "Snapping windows".
Make sure all 4 check boxes are checked and set resistance to 60 and attraction to 20.
This should help you keep your windows on a workstation.
However this is one of those taste things. Some people want things to span like this, others hate it. I personally am in the hate it group. I hope I am wrong, and that someone has a magic answer, but this is the best I have been able to find.
Just to make it clear, this won't stop the behavior, but it will make it a bit easier to manage.