Bootstrap and refactoring

For my work on bootstrap templating i have done a small fix and refactoring. This pull request depends on https://github.com/crowbar/barclamp-crowbar/pull/790