Function names changed to comply with style standards
Refactoring and cleaning up a bit
More little changes in tests