Use app.controller instead of a global function
Move random number generation into a service
Move JavaScript from index.html into several files
Convert indentation to spaces
Move constant texts to value services