Log Out - now a javascript method

Fixes #308