Break vagrant VM configuration logic out into helper functions.

Other cleanup done:
Fix a bug in one of the examples.
Add windows vim temp files to .gitignore.