Implemented better pattern matching algorithm in shell
Small fixes to teashell