JC: moved log and misc definition to commonx. Added index to tables.