Fix barclamp and name methods to work w/ templates

```barclamp``` method, when called on a barclamp template, returned
'template'. Similarly, ```name``` returned the barclamp name.

This then broke the all_elements method and possibly others.
Send bad request for invalid role in elements_info

BNC#865811

$ crowbar keystone element_node foo

now returns bad request instead of returning all nodes.
Add method for dependency lookups for active roles
Check for dependencies when deactivating proposal

BNC#867353

Whenever a proposal is deactivated, check that none of the active roles
depend on it.
Fix elements to not return config-* roles

BNC#865811

e.g:

    $ crowbar network elements

previously returned network-config-default as well, in which we're not
interested.

It uses ProposalObject#all_elements instead of RoleObject + filter.
Make the constraint checks reusable
Do not return nodes that do not pass a constraint

BNC#865811

E.g.:

     $ crowbar keystone element_node keystone-server

should not return any admin nodes, as they cannot be assigned to the
keystone-server.
Merge pull request #1016 from bkutil/role_dependencies

Role dependencies
Merge pull request #1007 from bkutil/fix_rest_methods

Send bad request for invalid role in elements_info
Add check whether current version of a proposal is applied
Show whether proposal has been applied
Merge pull request #1017 from bkutil/applied_proposals

Show if the proposal has been applied.