Basic cleanup.
Tests =D ! And some minor bugfixes.