Added namespace option. Various clean-ups.