Functions now copied by string instead of separate files

Massive code reorganization