Rewrite into Swift.

Excluded list:

- [ ] LoginUtil
- [ ] AKHotKeyManager (since C function is used.)