added models validation
created register function and reworked views/controllers
merging master and andu