Merge pull request #68 from jnoring/master

Use switching rules defined in OSMF, some code cleanup, etc.
Merge remote-tracking branch 'upstream/master'