PSR-2 compliance

Library code is now PSR-2 compliant.