moved external code into separate directory
restructured files, separated source code from tests