Modularized bostock's calendar function into a more reusable pattern.