bug fix and disable some debug

fixed a bug in the function for clearing session/local storage. Also
added better error reporting.
model - remove old code. disable some debug
navcats - remove some duplicate code