Refactor loading of post values for the API

Remove huge union query in Post model. Instead we're iterating over a
list of post attribute types and loading values through
$model->load_values_for_post().

Attribute types are now stored in Model_Form_Attribute::_attribute_types.
This should allow us to extend later and add custom type through
plugins.

Post_Value:: load_values_for_post() grabs the values for this post
along with their attribute data. We then iterate over these as we
did before.

We've also moved the date time formatting into the Post_Datetime
model get/set functions.
Remove special handling of 'unknown' for date fields, use null instead
Skip saving values for empty or null fields

This is so we don't save the current date, when actually 'null' was sent.
Also avoid extra junk data for empty varchars, etc.
Wiring up workspace published/unpublished/all posts views (Rough)

- Add routes for posts/all, posts/unpublished, posts/. Routes for these
will set status
filter and then render the normal ‘index’ controller action.
- Hide tasks and tutorials in workspace menu
- Add PostCollection.setFilterParams() function which handles combining
filters
with paging params and reloading if filters change.
Improve handling of frontend 'view' switching: map, list, full

- Move handling of views for home layout (map, list, search) into
HomeLayout
- Maintain the 'view' as a state on the Home Layout. This means we can
return to the last ‘view’ the user selected, not always back to ‘full’
post view.
- Add HomeLayout.setViews() that lets you set which views (map, list,
search) to render
- Add onClose() callback to MapView to destroy the leaflet map object
when the view is hidden.
- Link ‘Full’ view to /view/full since index now renders which view was
shown last
- Not loading MapView in Controller directly so we have to require
  it for postDetail
Avoid triple reload of posts during paging, etc

Post list was loading post 4 times when each page changes.
This was because the ‘remove’ event is fired for each post
in the list as its replace. We’re moving the fetch() call to
PostItemView.deletePost() since that when we actually
wanted this reload.
Pass posts filter params to map view

Map view now grabs filter params from collection and passes them
to the GeoJSON api when loading posts.

- Moved mapView data url handling to MapView.getDataUrl()
- Add PostCollection.getFilterParams() api to grab filter params
- Pass filter params to jquery.ajax data param
Reset posts filters in 'index' controller

Reset the posts filters when user hits index. Stop calling this
controller internally
on workspace views to avoid accidental resets.
Fix rerendering the home layout

Only call show(homeLayout) when its not already visible. This avoids a
heap
of extra JS work and avoid we’re jumpy-ness.
Avoid using global App.Collections.Posts in HomeLayout

Pass post collection when creating home layout instance, use that for
child views.
Trigger map reload when post filters change.
Fix list view not hiding the map properly.
WIP
Improve/update handling on active view and workspace menu itmes

Wire active menu item in workspace menu to 'page:change' events
Wire active view to ‘view:change’ events
Fixing coding style on single line statements
Remove filters method completely
Merge pull request #171 from ushahidi/workspace-posts-views

Wire up workspace views for all posts, unpublished posts, published posts
Merge pull request #169 from ushahidi/refactor-post-value-loading

Refactor post value loading
Merge branch 'master' into cloud
Cloud: Respect active/inactive flag for sites.