Jboxes now wrap the date properly

Also some refactoring to get rid of repetitive code.