Added doctrine

Changed module to doctrine style
Added doctrine pagination
fixed errors in original code