Improved to use ct library

ct library is my personal JS library which covers many common basic
tasks and improves cross-browser support.