ui.js - Responsible for building UI, rendering HTML markups, etc.
model.js - Handle and organize data. Provide data utilities, etc.
ajax.js - Make ajax calls. Handle response headers, remote errors, etc.
main.js - Make everything together.
Demo: http://www.runademo.com/agl-code-test/v2
Unit test: http://www.runademo.com/agl-code-test/v2/code-test.html
UI test : http://www.runademo.com/agl-code-test/v2/ui-test.html