Backporting updates and refactors from middleman-bss template.