Refactoring of visualisation code to more extensible, maintainable structure

This is a fairly substantial commit. Essentially:

1. Improves D3 code to have a single unified chart function
2. Rewrites the code of the counter.js to provide the count_data as an array, rather than as part of the cell_types object
3. Gracefully handle the situation that ```/api/cell_types/``` endpoint is not available, and error to the user
4. Style the ```total``` divs in css, rather than hardcoded ```style=```
5. Correctly implement a conditional script for ```js/toisostringshim.js```