remove codes derived from Kiret
cleanup server code
Merge branch 'portable-lib'