split core/sec, add jaas, some cleanup