Major rewrite to incorporate browser interface.