Put display code together where it belongs and fix javascript autodetect