Changes to the model.

- fixed bug in postmessage
- more consistent use of Origin
- s/url2origin/origin
- other misc fixes
Merge pull request #29 from spderosso/master

Changes to the model