Refactoring D3 and CSS

Manual redo of D3 and CSS refactoring; file uploads are now in a separate branch, awaiting tests