Reorganizes init.js to bring Kapi operations closer to each other.