Move box directive into the module, tidy up the code, remove unnessery dependencies