Added license header and code reformat.
Refactor module layout.