Complete redesign of basic functions

Renamed some functions and removed useless ones. No backwards
compatibility with previous versions.