Refractor of modules

Changed module declarations and added necessary module headers.