kwixer.js: added most of the functionality.

Still having trouble with the template.