Re-organize for maven.
Change package name and fixed a synchronization bug.