Moved lessons to wtforms, fixes and code tidying