Refactored all kiwk-related functions into kwik module.