Minor reordering according to common convention

Order:
1. module functions
2. error classes
3. module classes