javascript cleanup
added category filtering and improved filtering mechanism