clean up frontend code to use js in angular directive; add paint board