Reorganized files into subdirectories.
Build common code as base library for apps.