1. Add more service state query
2. fix problem that do not accept sb dir as input.
1. Seperate main method.
2. fix the -P problem
3. Use a more efficient way to search last selected window id.
Eliminate duplicate windows name.
Fix problems that
1. cannot send "case closed".
2. sed error when download and update case whose title has /.
Fix error cannot send case closed.
Filter special character in title so it won't affect the regex
Also check owner property for case.