Rearchitected to allow packaging as Chrome app