app.js created

Moved script to outside from html for better testability.