Separated things into files. Fixed CPU higging loop in Dockerfile.