Improved js and templates

Hi,

This is my first pull request and I hope you can approve it.

I changed the failures/index template to confirm on retry and clear, removed the js code that is not used more and changed js to coffe with a better organization.

Thank you