Debugging recently found issues

## Changes

- Added naming to collections to easliy identify which collection we
are in when debugging
- Realised that tags for tumblr items were not being created because
tumblr items had isDocument and isFile undefined as it is a virtual
document, which the collection isHTML required
- Updated isHTML to check for write:true instead of isDocument and
isFile
- Added isDocument and isFile defaults

## Choices
This leaves us with the following choices

### documents/files as types

- then partials,layouts would be inside the documents collection - very
bad
- can work around by having documents,files collections check for
write:true
- then we have write:false draft documents inside the documents
directory not inside the documents collection
- result is isDocument,isFile set appropriatly for types

### documents/files as directories

- then importers have problems
- can work around by having html,stylesheet collections check for
write:true
- result is isDocument,isFile undefined for imported documents
Merge branch 'master' into dev
Got tests passing for core and plugins - docpad-website is failing howerver

- Fixed virtual documents firing duplicated events
	- Added `cloneModel(model)` to properly handle events when cloning
(`model.clone()` will no longer clone events)
- Fixed `Object #<Model> has no method 'setDefaults'` error (bug since
v6.46.3)
	- Moved `FileModel::setDefaults` back into `Base::setDefaults`
	- Thanks to [Jeff Barczewski](https://github.com/jeffbski) for
[bevry/docpad-documentation#40](https://github.com/bevry/docpad-document
ation/pull/40)
- Fixed the 500 middleware not working
- Added ability to do `getCollection('database')` to get the global
database
- Added `render` alias for documents directory
- Added `static` alias for files directory
- The `documents` collection is now defiend by `render:true,
write:true` rather than being paths and `isDocument:true` based
- The `files` collection is now defiend by `render:false, write:true`
rather than being paths and `isFile:true` based
- The `html` collection is now checks for `write:true` instead of
`isDocument:true` or `isFile:true`
- The `stylesheet` collection is now checks for `write:true` instead of
`isDocument:true` or `isFile:true`
- Re-added `DocPad::parseDocumentDirectory` and `parseFileDirectory`
(removed from v6.46.0) which wraps around the new ways of doing things
- Added `DocPad::createModel(attrs,opts)` and updated
`DocPad::createDocument` and `DocPad::createFile` to use it
- Added `DocPad::ensureModel(attrs,opts)` and updated
`DocPad::ensureDocument`, `DocPad::ensurefile`, and
`DocPad::ensureFileOrDocument` to use it
- Added `DocPad::attachModelEvents(model)` to attach the required
docpad events to a model
Little bit of work on the changelog from the last commit, need to do the other changes as well
v6.46.4. Bugfix. Improvement.

- v6.46.4 July 27, 2013
	- Fixes
		- Fixed virtual documents firing duplicated events
			- Plugins should now use `DocPad::cloneModel(model)` instead of
`model.clone()` as the latter can't bind events correctly
		- Fixed `Object #<Model> has no method 'setDefaults'` error (bug
since v6.46.3)
			- Moved `FileModel::setDefaults` back into `Base::setDefaults`
			- Thanks to [Jeff Barczewski](https://github.com/jeffbski) for
[bevry/docpad-documentation#40](https://github.com/bevry/docpad-document
ation/pull/40)
		- Fixed the 500 middleware not working
	- Changes
		- The `documents` collection is now defined by `render:true,
write:true` rather than being paths and `isDocument:true` based
		- The `files` collection is now defined by `render:false, write:true`
rather than being paths and `isFile:true` based
		- The `html` collection now checks for `write:true` instead of
`isDocument:true` or `isFile:true`
		- The `stylesheet` collection now checks for `write:true` instead of
`isDocument:true` or `isFile:true`
	- Additions
		- Added ability to do `getCollection('database')` to get the global
database
		- Added naming to collections to easily identify which collection we
are in when debugging
		- Added `render` alias for documents directory
		- Added `static` alias for files directory
		- Added logging for event emits
		- Re-added `DocPad::parseDocumentDirectory` and `parseFileDirectory`
(removed from v6.46.0) which wraps around the new ways of doing things
		- Added `DocPad::createModel(attrs,opts)` and updated
`DocPad::createDocument` and `DocPad::createFile` to use it
		- Added `DocPad::ensureModel(attrs,opts)` and updated
`DocPad::ensureDocument`, `DocPad::ensurefile`, and
`DocPad::ensureFileOrDocument` to use it
		- Added `DocPad::attachModelEvents(model)` to attach the required
docpad events to a model
Merge branch 'master' into dev-scheduling
Fixed typo in comment