DB implementation, preliminary bug fixes, connected front end to MySQL backend